<template>
  <el-checkbox-group v-model="formData[formData.valueName]" :disabled="formStatus === 'info'" :min="formData.min" :max="formData.max">
    <el-checkbox v-for="data in options" :key="data.value"  :label="data.value">{{ data.label }}</el-checkbox>
  </el-checkbox-group>
</template>

<script setup name="checkbox">
import {ref, watch} from "vue";

const options = ref([
  {
    label: '选项1',
    value: '1',
  },
  {
    label: '选项2',
    value: '2',
  },
  {
    label: '选项3',
    value: '3',
  }
])
const props = defineProps({
  formData: {
    type: Object,
    default: () => {},
    required: true
  },
  formStatus: {
    type: String,
    default: 'edit'
  }
})
options.value = JSON.parse(JSON.stringify(props.formData.customizeData))
watch(props,(newProps, oldProps) => {
  options.value = JSON.parse(JSON.stringify(newProps.formData.customizeData))
});
</script>

<style scoped lang="scss">

</style>
